<template>
  <div class="">
    <searchC @handlerQuery="handlerQuery"></searchC>
    <tableC :bagFlag="bagFlag" :searchParams="searchParams"></tableC>
  </div>
</template>

<script>
import searchC from "@/views/maintenance/operation/maintenance/components/bagC/search.vue";
import tableC from "@/views/maintenance/operation/maintenance/components/bagC/table.vue";
export default {
  components: {
    searchC,
    tableC,
  },
  props: {
    activeName: {
      type: String,
      default: "1",
    },
  },
  data() {
    return {
      bagFlag: "", // 三级菜单tab钩子
      searchParams: {}, // 查询条件
    };
  },
  watch: {
    activeName: {
      handler(val) {
        if (val) {
          switch (this.activeName) {
            // case "1":
            //   this.bagFlag = "number"; // 数据包
            //   break;
            // case "2":
            //   this.bagFlag = "heartbeat"; // 心跳包
            //   break;
            // case "3":
            //   this.bagFlag = "control"; // 控制包
            //   break;
            case "1":
              this.bagFlag = "bag"; // 包管理
              break;
          }
        }
      },
      deep: false,
      immediate: true,
    },
  },
  created() {},
  mounted() {},
  methods: {
    handlerQuery(val) {
      this.searchParams = val;
    },
  },
};
</script>

<style lang="scss" scoped>
</style>
